package com.ea.mapper;

import com.ea.domain.entity.ElectricGoodsInfo;
import com.ea.domain.query.BackElectricGoodsQueryDTO;
import com.ea.domain.query.FrontElectricGoodsQueryDTO;
import com.ea.domain.vo.ElectricGoodsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 电器信息表 Mapper 接口
 * </p>
 *
 * @author 电器商城
 * @since 2022-11-29
 */
@Mapper
public interface ElectricGoodsInfoMapper {

    /**
     * 货品列表查询
     * @param queryDTO queryDTO
     * @return list
     */
    List<ElectricGoodsInfo> queryAllInfoList(BackElectricGoodsQueryDTO queryDTO);

    /**
     * 添加货品信息
     * @param goodsInfo
     */
    void insertElectricGoods(ElectricGoodsInfo goodsInfo);

    /**
     * 根据goodsId查找货品
     * @param goodsId
     * @return
     */
    ElectricGoodsInfo selectGoodsInfoByGoodsId(@Param("goodsId") Long goodsId);

    /**
     * 根据goodsId查找货品
     *
     * @param goodsIdList goodsIdList
     * @return list
     */
    List<ElectricGoodsVO> selectGoodsShowVOByGoodsIdList(@Param("list") List<Long> goodsIdList);

    /**
     * 更新货品信息
     *
     * @param goodsInfo
     * @return
     */
    Boolean updateGoodsInfo(ElectricGoodsInfo goodsInfo);

    /**
     * 更新货品状态
     * @param goodsId
     * @param status
     */
    void updateGoodsStatus(@Param("goodsId") Long goodsId, @Param("status")Integer status);

    /**
     * 更新货品状态
     * @param goodsId
     * @param status
     */
    void updateBlockStatus(@Param("goodsId") Long goodsId, @Param("status")Integer status);


    /**
     * 前台货品列表查询
     * @param queryDTO queryDTO
     * @return list
     */
    List<ElectricGoodsVO> queryAllInfoListFront(FrontElectricGoodsQueryDTO queryDTO);

}
